<%inherit file="/base.html" />
<%namespace name="utils" file="/utils.html"/>

<%def name="doc_head()">
  <link rel="stylesheet" href="${ app.url_for('static', filename='css/favorites.min.css') } ">
</%def>

<%def name="content()">
  <ul class="types">
    % for type_, label in [('movie', '电影'), ('book', '读书'), ('game', '游戏')]:
    <li ><a href="${ app.url_for('blog.favorites', type=type_) }" class="type">
      <span class="${ 'checked' if type == type_ else '' }">${label}</span></a></li>
    % endfor
  </ul>

  <div class="subjects">
    % for subject in paginatior.items:
    <a target="_blank" href="${subject.target_url}" class="item ${ 'tool' if subject.comment else ''  }" data-tip="${ subject.comment if hasattr(subject, 'comment') else '' }">
      <div class="cover">
        <span class="pic">
          <img src="${subject.cover}" alt="${subject.title}"></span>
      </div>
      <fieldset class="rate">
         % for i in range(1, int(subject.rating * 2) + 1)[::-1]:
          <input type="radio" id="rating${ i }" name="rating" value="${ i }" /><label ${ 'class=half' if i % 2 ==1 else '' } for="rating" title="${ i / 2 } stars"></label>
        % endfor
      </fieldset>
      <p>
        <span class="title">${subject.title}</span>
      </p>
    </a>
    % endfor
  </div>
</%def>

<%def name="pagination()">
${ utils.pagination('blog.favorites', paginatior, type=type) }
</%def>
